//package com.example.springai.config;
//
//import org.springframework.http.HttpRequest;
//import org.springframework.http.client.ClientHttpRequestExecution;
//import org.springframework.http.client.ClientHttpRequestInterceptor;
//import org.springframework.http.client.ClientHttpResponse;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//
//@Component
//public class RestTemplateLoggingInterceptor implements ClientHttpRequestInterceptor {
//
//    @Override
//    public ClientHttpResponse intercept(HttpRequest request, byte[] body, ClientHttpRequestExecution execution)
//            throws IOException {
//        // 打印请求信息
//        System.out.println("Request Method: " + request.getMethod());
//        System.out.println("Request URI: " + request.getURI());
//        System.out.println("Request Headers: " + request.getHeaders());
//        System.out.println("Request Body: " + new String(body));
//
//        // 继续执行请求
//        ClientHttpResponse response = execution.execute(request, body);
//
//        // 打印响应信息（可选）
//        System.out.println("Response Status Code: " + response.getStatusCode());
//        return response;
//    }
//}
